package homework2;

import java.util.Scanner;

public class Test2 {
	public static void show(){
		System.out.println("   * **** **** *  * **** **** **** **** **** **** ");
		System.out.println("   *    *    * *  * *    *       * *  * *  * *  * ");
		System.out.println("   * **** **** **** **** ****    * **** **** *  * ");
		System.out.println("   * *       *    *    * *  *    * *  *    * *  * ");
		System.out.println("   * **** ****    * **** ****    * **** **** **** ");
	}

	public static void show1() {
		System.out.print("   * ");
	}

	public static void show2() {
		System.out.print("*    ");
	}

	public static void show3() {
		System.out.print("*  * ");
	}

	public static void show4() {
		System.out.print("**** ");
	}
	
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		show();
		System.out.println("请输入数字字符串：");
		String a = input.next();
		char[] b = a.toCharArray();
		for (int i = 0; i < 5; i++) {
			for (int k = 0; k < b.length; k++) {
				if (i == 0) {
					if (b[k] == '1') {
						show1();
					} else if (b[k] == '4') {
						show3();
					} else if (b[k] == '2' || b[k] == '3' || b[k] == '5' || b[k] == '6' || b[k] == '7' || b[k] == '8'
							|| b[k] == '9' || b[k] == '0') {
						show4();
					}
				} else if (i == 1) {
					if (b[k] == '1' || b[k] == '2' || b[k] == '3' || b[k] == '7') {
						show1();
					} else if (b[k] == '4' || b[k] == '8' || b[k] == '9' || b[k] == '0') {
						show3();
					} else if (b[k] == '5' || b[k] == '6') {
						show2();
					}
				} else if (i == 2) {
					if (b[k] == '1' || b[k] == '7') {
						show1();
					} else if (b[k] == '2' || b[k] == '3' || b[k] == '4' || b[k] == '5' || b[k] == '6' || b[k] == '8'
							|| b[k] == '9') {
						show4();
					} else if (b[k] == '0') {
						show3();
					}
				} else if (i == 3) {
					if (b[k] == '1' || b[k] == '3' || b[k] == '4' || b[k] == '5' || b[k] == '7' || b[k] == '9') {
						show1();
					} else if (b[k] == '2') {
						show2();
					} else if (b[k] == '6' || b[k] == '8' || b[k] == '0') {
						show3();
					}
				} else if (i == 4) {
					if (b[k] == '1' || b[k] == '4' || b[k] == '7') {
						show1();
					} else {
						show4();
					}
				}
			}
			System.out.println();
		}
	}
}
